#include "thread.hpp"
#include <unistd.h>
#include <memory>
void *thread_run(void *args)
{
    std::string work_type = static_cast<const char *>(args);
    while (true)
    {
        printf("我是一个新线程, 我正在做: %s\n", work_type.c_str());
        sleep(1);
    }
}
int main()
{
    std::unique_ptr<Thread> thread1(new Thread(thread_run, (void *)"hellothread", 1));
    std::unique_ptr<Thread> thread2(new Thread(thread_run, (void *)"countthread", 2));
    std::unique_ptr<Thread> thread3(new Thread(thread_run, (void *)"logthread", 3));
    thread1->join();
    thread2->join();
    thread3->join();
    return 0;
}